﻿
namespace EveKillboard.Core.Views
{
    using System.ComponentModel.DataAnnotations;

    public interface IItemView
    {
        int ItemId { get; set; }
        string ItemName { get; set; }
    }

    public interface IItemGroupView
    {
        short GroupId { get; set; }
    }

    public abstract class EntityItemUsedView : TopView, IItemView
    {
        public virtual int ItemId { get; set; }
        public virtual string ItemName { get; set; }
    }

    [Table("CharacterShipGroupsKillsView")]
    public sealed class CharacterShipGroupsKillsView : IItemGroupView, ITopView
    {
        [Key]
        [Column("CharacterInternalID")]
        public int InternalId { get; set; }
        [Column("GroupID")]
        public short GroupId { get; set; }
        [Column("GroupName")]
        public string Name { get; set; }
        [Column("Count")]
        public int Count { get; set; }
        [NotMapped]
        public int EveId { get; set; }
        [NotMapped]
        public decimal Value { get; set; }
    }

    [Table("CharacterShipsView")]
    public sealed class CharacterShipsView : EntityItemUsedView, ICharacterView, IAllTimeView
    {
        [Key]
        [Column("CharacterInternalID")]
        public override int InternalId { get; set; }
        [Column("CharacterEveID")]
        public override int EveId { get; set; }
        [Column("CharacterName")]
        public override string Name { get; set; }
        [Column("ShipID")]
        public override int ItemId { get; set; }
        [Column("ShipName")]
        public override string ItemName { get; set; }
        [Column("Count")]
        public override int Count { get; set; }
        [NotMapped]
        public override decimal Value { get; set; }
    }

    [Table("CharacterWeaponsView")]
    public sealed class CharacterWeaponsView : EntityItemUsedView, ICharacterView, IAllTimeView
    {
        [Key]
        [Column("CharacterInternalID")]
        public override int InternalId { get; set; }
        [Column("CharacterEveID")]
        public override int EveId { get; set; }
        [Column("CharacterName")]
        public override string Name { get; set; }
        [Column("WeaponID")]
        public override int ItemId { get; set; }
        [Column("WeaponName")]
        public override string ItemName { get; set; }
        [Column("Count")]
        public override int Count { get; set; }
        [NotMapped]
        public override decimal Value { get; set; }
    }
}